<!DOCTYPE >
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>基本设置</title>
<css   href="__PUBLIC__/home/css/right.css" />
<js href="__PUBLIC__/home/js/jquery.js" />
<js href="__PUBLIC__/home/js/system.js" />
</head>
<body >
	<div class="basic bor">
			<div class="title fl">当前位置：留言管理 > 编辑选项</div>
			<div class="basic_r fr"><a href="setting.html">基本信息</a></div>
	</div>

<!-- 文章分类列表 -->
<div class="catelist mess_top">
    <div class="lists">
    <a href="{:U('Message/index')}" class="mess_nav fl ">留言列表</a>
    <a href="#" class="mess_nav fl upbg">编辑选项</a>
       
    
    </div>

</div>
<!-- /文章分类列表 -->
<div class="messageediting">
    <div class="addsting">
       
        <div class="ncontent">
                <form action="" method="post">
                    <div class="setting">
                        <ul id = "J_list">
                        <volist name ="items_list" id = "vo">
                       <if condition="$vo.is_delete eq 1 ">
                            <li>
                                <dd class="setting_t fl">{$vo.item} ：</dd>
                                <dd class="setting_p fl">
                                <input class="seinp" type="text" name="company" value="">
                                 <span color="red">不可删除</span>
                                </dd>
                            </li>
                            <div class="clear"></div>
                        <elseif condition="$vo.type eq 0"/>
                            <li class = "type_data">
                                <dd class="setting_t fl">{$vo.item} ：</dd>
                                <dd class="setting_p intop fl">
                                <input class="seinp" type="text" name="company" value="">
                                 <div class="spic">
                                      <a href="" title="上移"></a>
                                      <a href="" title="下移"></a>
                                  </div>
                                  <span class="mesdel"><a href="{:U('Message/deleteItem',array('id'=>$vo['id']))}" title="删除该选项">删除</a></span>
                                </dd>
                            </li>
                             <div class="clear"></div>
                        <else/> 
                            <li class = "type_data">
                                <dd class="setting_t fl">{$vo.item} ：</dd>
                                <dd class="setting_p fl">
                                <textarea name="" class="textarea bor"></textarea>
                                 <div class="spic">
                                      <a href="" title="上移"></a>
                                      <a href="" title="下移"></a>
                                  </div>
                                  <span class="mesdel"><a href="{:U('Message/deleteItem',array('id'=>$vo['id']))}" title="删除该选项">删除</a></span>
                                </dd>
                            </li>
                            <div class="clear"></div>


                       </if>
                         </volist>
                          
                            <!-- <li>
                                <dd class="setting_t fl">邮箱 ：</dd>
                                <dd class="setting_p fl">
                                <input class="seinp" type="text" name="" value="">
                                  <div class="spic">
                                      <a href="" title="上移"></a>
                                      <a href="" title="下移"></a>
                                  </div>
                                  <span class="mesdel"><a href="" title="删除该选项">删除</a></span>
                                </dd>
                            </li> 
                            <div class="clear"></div>-->
                            <div class="clear"></div>
                            </ul>
                             </form>
                             <form id = 'J_SubmitForm' >
                             <ul>
                            <li>
                                <dd class="setting_t fl"> &nbsp;</dd>
                                <dd class="setting_p fl">
                                <input class="seinp input154" type="text" id = "J_input" name="item" value="" placeholder="如：邮箱：">
                                <select name="type" id="J_type">
                                        <option value="0">普通文本框</option>
                                        <option value="1">长文本框</option>
                                </select>
                                <input class="submit" type="submit" name="" id = "J_submit" value="添加选项">
                                </dd>
                            </li>
                            <div class="clear"></div>
                        </ul>
                        

                    </div>
                    </form>
            </div>


    </div>

</div>

<script>
    $("#J_submit").click(function(){
        var item = $("#J_input").val();
        var type = $("#J_type").val();
        var url = "{:U('Message/ajax_submit')}";
        var data = $('#J_SubmitForm').serializeArray();
        $.ajax({
                type: "POST",
                dataType: 'json',
                async: false,
                url: url,
                data: data,
                success: function(res){
                    if (res.status == '1') {
                        alert(res.info);
                        var shtml = '<li class = "type_data">';
                            shtml += '<dd class="setting_t fl">'+item+'：</dd>';
                            shtml += '<dd class="setting_p intop fl">';
                            if(type ==0){
                               shtml += '<input class="seinp" type="text" name="company" value="">';
                            }else{
                               shtml += '<textarea name="" class="textarea bor"></textarea>';
                            }
                            shtml += '<div class="spic"><a href="" title="上移"></a><a href="" title="下移"></a></div>';
                            shtml += '<span class="mesdel"><a href="{:U("Message/delete",array("id"=>'+res.id+'))}" title="删除该选项">删除</a></span>';
                            shtml += '</dd></li><div class="clear"></div>';
                        $("#J_list").append(shtml);    

                    }else{
                        alert(res.info);
                        return false;
                    }
                },
                error: function(){
                     
                },
        });
        

    });
</script>      

<!-- 提示 -->
<p class="ts"><span class="colorf00">*</span><span class="ts_text">要调整顺序直接点击右边的箭头进行位置调整或删除。</span></p>


</body>
</html>